<!--
 * @Descripttion:
 * @version:
 * @Author: xiajunchen
 * @Date: 2021-05-28 10:19:06
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2021-05-31 11:05:10
-->
<template>
  <el-select
    v-model="value"
    class="el-select-search"
    :placeholder="this.$props.items.placeholder || '请选择'"
    @change="change"
  >
    <el-option
      v-for="item in this.$props.items.options"
      :key="item.value"
      :label="item.label"
      :value="item.value"
    />
  </el-select>
</template>
<script>
export default {
  name: 'Selectcomp',
  props: {
    items: {
      type: Object,
      default: () => ({ options: [] })
    }
  },
  data: () => ({ value: '' }),
  mounted() { this.value = this.$props.items.value },
  methods: {
    change(e) {
      this.$parent.gatherParams({
        type: 'Select',
        key: this.$props.items.key,
        value: e || this.value
      })
    }
  }
}
</script>
